package cz.zcu.fav.ratdroid.activity.calendar.provider;
import cz.zcu.fav.ratdroid.bean.Object;

import org.joda.time.LocalDate;
import org.joda.time.LocalDateTime;

import android.content.Context;
import cz.zcu.fav.ratdroid.activity.calendar.day.BlockView;
import cz.zcu.fav.ratdroid.bean.Occupations;
import cz.zcu.fav.ratdroid.bean.Period;
import cz.zcu.fav.ratdroid.bean.Reservations;
import cz.zcu.fav.ratdroid.service.IRestListener;
import cz.zcu.fav.ratdroid.service.RestService;
import cz.zcu.fav.ratdroid.service.RestTask;

public class PersonalCalendarDataProvider implements ICalendarDataProvider
{
	private static final long serialVersionUID = -4805046306367011364L;

	public RestTask<Occupations> getDatesOccupation(Context context,
			int month, int year, IRestListener<Occupations> listener)
	{
		return RestService.getInstance().getDatesUserOccupation(context, month,
				year, listener);
	}

	public RestTask<Reservations> getReservations(Context context,
			LocalDateTime since, LocalDateTime to,
			IRestListener<Reservations> listener)
	{
		return RestService.getInstance().getReservationsByUser(context, since,
				to, listener);
	}
	
	public Object provideObject()
	{
		// we dont want to serve any object - calendar should start object browser then
		return null;
	}

	public BlockView getBlock(Context context, String title, 
			 int column, Period period, LocalDate selectedDate)
	{
		return new BlockView(context, title, column, period, selectedDate);
	}

}
